extends HBoxContainer

@export var x_input: LineEdit
@export var y_input: LineEdit
@export var z_input: LineEdit

signal dir_input(dir: Vector3)

func on_generate():
	if not x_input.text.is_valid_float():
		return
	if not y_input.text.is_valid_float():
		return
	if not z_input.text.is_valid_float():
		return
	
	var x := x_input.text.to_float()
	var y := y_input.text.to_float()
	var z := z_input.text.to_float()
	
	x_input.clear()
	y_input.clear()
	z_input.clear()
	
	get_window().gui_release_focus()
	
	dir_input.emit(Vector3(x, y, z).normalized())
